home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10321 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.bellglobal.com!news
  2. From: dlowe@pathcom.com (David Lowe)
  3. Newsgroups: comp.lang.c
  4. Subject: A Simple Question From A Beginner (Please Help)
  5. Date: Mon, 11 Mar 1996 21:38:11 GMT
  6. Organization: Mettis Software Solutions Inc.
  7. Message-ID: <4i26gm$6th@news.bellglobal.com>
  8. NNTP-Posting-Host: 199.243.250.173
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11.  
  12. This should be a simple thing to execute but for some reason I can not
  13. get it to work.
  14.  
  15.  
  16. What I would like to do is execute something like a SHELL command.
  17. What I would like to do in C or C++ is the equivelent to typing the
  18. following at the Win NT command line:
  19.  
  20.  
  21.     sendmail dlowe@pathcom.com < mail.txt
  22.  
  23. I have tried the following code:
  24.  
  25.    _spawnl( _P_WAIT, "sendmail.exe", "dlowe@pathcom.com < mail.txt", 
  26.              NULL);   
  27.  
  28. and 
  29.  
  30.  
  31.     args[0] = "child";
  32.     args[1] = "dlowe@pathcom.com < c:\\notes\\data\\clustrep.txt";
  33.     args[2] = NULL;
  34.     args[3] = NULL;
  35.     .
  36.     .
  37.     .
  38.    _spawnvp( _P_OVERLAY, "c:\\Sendmail\\Sendmail.exe", args );
  39.  
  40.  
  41. My problem ranges from nothing happends to Sendmail not see the
  42. parameters  properly.
  43.  
  44. Any help would be greatly appreaciated.
  45.  
  46. Thanks,
  47.  
  48. David
  49.  
  50.